<div bsModal #actionModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="actionModal" aria-hidden="true"
  [config]="{backdrop: 'static'}">
  <div class="modal-dialog">
    <div class="modal-content">
      <form *ngIf="active" #editForm="ngForm" novalidate (ngSubmit)="save()">

        <div class="modal-header">
          <h4 class="modal-title">
            <span>输入投产信息</span>
          </h4>
          <button type="button" class="close" (click)="close()" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>

        <div class="modal-body">
          <div class="form-group form-md-line-input form-md-floating-label no-hint">
            <label>投产数量
              <span class="text-danger">*</span>
            </label>
            <input class="form-control" name="amount" type="number" min="1" [ngClass]="{'edited': amount}" [(ngModel)]="amount" required>
          </div>
          <div class="form-group form-md-line-input form-md-floating-label no-hint">
            <label style="display: block;">完成时间
              <span class="text-danger">*</span>
            </label>
            <!-- <input #dueDatePicker name="dueDatePicker" class="form-control" [ngClass]="{'edited': dueDate}" [ngModel]="dueDate?(dueDate | momentFormat:'YYYY年M月D日'): ''"
              ng-minlength="1" required> -->
              <div>
                <p-calendar [(ngModel)]="dueDate" [inputStyle]="{'width':'415px'}" name="dueDate" dateFormat="yy-mm-dd" [showIcon]="true" ></p-calendar>
              </div>
              
          </div>
          <div class="form-group form-md-line-input form-md-floating-label no-hint">
            <label>管道模板
              <span class="text-danger">*</span>
            </label>
            <select #tmplCombobox class="form-control" name="tmplName" [ngClass]="{'edited': tmplName}" [(ngModel)]="tmplName" title="选择管道模板">
              <option value="">{{emptyText}}</option>
              <option *ngFor="let tmpl of tmpls" value="{{tmpl.name}}">{{tmpl.value.name}}</option>
            </select>
          </div>
        </div>

        <div class="modal-footer">
          <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{l("Cancel")}}</button>
          <button type="submit" class="btn btn-primary blue" [disabled]="!(editForm.form.valid && editForm.form.get('amount')?.value >= 1 && editForm.form.get('tmplName')?.value)"
            [buttonBusy]="saving" [busyText]="'投产中...'">
            <i class="fa fa-check-circle"></i>
            <span>投产</span>
          </button>
        </div>

      </form>

    </div>
  </div>
</div>
